package torinoflickrdata.analysis;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class TestHashMap {

	public static void main (String[]args)throws Exception{
		
		List<FOA>list = new ArrayList<FOA>();
		String path = "C:\\Users\\Alket\\codeindigo\\FlickrAPI\\GiancaCorrispondences.csv";
		
		FOAMethods.loadFOA(list,path);
		Collections.sort(list);
		
		Map<Integer,List<FOA>>map = new HashMap<Integer, List<FOA>>();
		
		map = FOAMethods.readFinalFile2Map(list);
			  for (int i: map.keySet()) {
				  for (int j = 0; j < map.get(i).size(); j++) {
					
					  if(i ==2){
						  System.out.println(map.get(i).get(j).toString());
					  }
					  
					  if(i ==80|| i ==123){
						  System.out.println(map.get(i).get(j).toString());
					  }
				}
				
			}
		FOAMethods.printMap("test2.csv", map);;
		
		
		
	}
		
		
		
		
		
		
		/*Map<Integer, List<String>>map = new HashMap<Integer, List<String>>();
		List<String>list1 = new ArrayList<String>();
		list1.add("prima stringa list1");
		list1.add("seconda stringa list1");
		List<String>list2 = new ArrayList<String>();
		list2.add("prima stringa list2");
		list2.add("seconda stringa list2");
		
		int i = 0;
		int j = 1;
		
		map.put(i, list1);
		map.put(j, list2);
		for(int k: map.keySet()){
			for (int k2 = 0; k2 < map.get(k).size(); k2++) {
				System.out.print(k+",");
				System.out.println(map.get(k).get(k2).toString());
			}
			
		}
		
		Iterator mapiter = map.keySet().iterator();
		while(mapiter.hasNext()){
			mapiter.next();
			mapiter.remove();
		}
		
		System.out.println("dopo l'iterazione");
		
		for(int k: map.keySet()){
			for (int k2 = 0; k2 < map.get(k).size(); k2++) {
				System.out.print(k+",");
				System.out.println(map.get(k).get(k2).toString());
			}
			
		}
		*/
	}
	

